package com.liruo.demo.serialize.jackson.factory;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;

/**
 * @Author:liruo
 * @Date:2023-02-20-02:39:33
 * @Desc
 */

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
// 指定序列化
@JsonSerialize(using = MySerializerFactory.class)
// 指定反序列化
@JsonDeserialize(using = MyDeserializerFactory.class)
public @interface ValuePrefix {

  @AliasFor("value")
  String prefix() default "前缀";

  @AliasFor("prefix")
  String value() default "前缀";
}
